﻿using System;
using System.IO;
using System.Xml.Serialization;

namespace TaskManager
{
    class Serializer
    {

        /// <summary>
        /// Writes all processes into a XML file
        /// </summary>

        public static bool write(ProcessRetriever settings, string path)
        {
            try
            {
                XmlSerializer x = new XmlSerializer(settings.GetType());
                StreamWriter writer = new StreamWriter(path);
                x.Serialize(Console.Out, settings);
                return true;
            }
            catch
            {
                return false;
            }

        }
    }
}
